home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 09.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-08-01  |  5.3 KB  |  274 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. PicAName = strip(line)
  30. line = readln(TempFile)
  31. XOffA = strip(line)
  32. line = readln(TempFile)
  33. YOffA = strip(line)
  34. line = readln(TempFile)
  35. ColorA = strip(line)
  36. line = readln(TempFile)
  37. PicBName = strip(line)
  38. line = readln(TempFile)
  39. XOffB = strip(line)
  40. line = readln(TempFile)
  41. YOffB = strip(line)
  42. line = readln(TempFile)
  43. ColorB = strip(line)
  44. line = readln(TempFile)
  45. Borders = strip(line)
  46. line = readln(TempFile)
  47. Shadows = strip(line)
  48. line = readln(TempFile)
  49. TopType = strip(line)
  50. line = readln(TempFile)
  51. BottomType = strip(line)
  52. line = readln(TempFile)
  53. TopColor = strip(line)
  54. line = readln(TempFile)
  55. BottomColor = strip(line)
  56.  
  57.  
  58.  
  59. call close TempFile
  60.  
  61. Frames = (End - Start)+1
  62. j=0
  63. k=0
  64. TFrames = Frames
  65. TNum = 3
  66. if TFrames > 999 then TNum = 4
  67. if TFrames > 9999 then TNum = 5
  68. if Field = 1 then TFrames = Frames*2
  69. do i = Start to End
  70.     k = k+ 1
  71.     call open TempFile,"RAM:VFXNums",W
  72.     call writeln TempFile,right(k,5,'0')
  73.     call writeln TempFile,right(Frames,5,'0')
  74.     call close TempFile
  75.     f=0
  76.     Redraw Off
  77.     j = j+ 1
  78.     FieldSet = 0
  79.     call DoIt()
  80.     Redraw On
  81.     call SaveIt()
  82.         if Field = 1 then do
  83.             Redraw Off
  84.             j = j + 1
  85.             FieldSet = 1
  86.             call DoIt()
  87.             Redraw On
  88.             call SaveIt()
  89.             end 
  90.     end
  91.     Undo On
  92. exit
  93.  
  94.  
  95.  
  96. LoadA:
  97.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  98.         Undo On
  99.         exit
  100.         end
  101.     if IAType = 0 then do
  102.         LoadBuffer PicName Force i
  103.         if Field = 1 then do
  104.             GetMain
  105.             parse var result Name Width Height Blah
  106.             if FieldSet = 0 then do
  107.                 Hook DeInterlace
  108.                 Scale Width Height
  109.                 end
  110.             if FieldSet = 1 then do
  111.                 Hook DeInterlace
  112.                 Swap
  113.                 Scale Width Height
  114.                 end
  115.             end
  116.         end
  117.     if IAType = 1 then do
  118.         LoadBuffer PicName Force 1
  119.         end
  120.     if IAType = 2 then do
  121.         LoadBuffer PicName Force
  122.         end
  123.     if IAType = 3 then do
  124.         LoadBuffer PicName""right(i,TNum,'0') Force
  125.         end
  126. return
  127.  
  128.  
  129. SaveIt:
  130.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  131.         Undo On
  132.         exit
  133.         end
  134.     if SaveType = 0 then do
  135.         call Switcher(TOSW)
  136.         call Switcher(MDV1)
  137.  
  138.         Render Go
  139.         if Field = 1 then
  140.                 call RecordAdd(SaveName,1,6,Compression)
  141.         else
  142.                 call RecordAdd(SaveName,2,6,Compression)
  143.         if j = TFrames then
  144.             call MakeIcon(SaveName,(Frames-10))
  145.         end
  146.  
  147.     if SaveType = 1 then do
  148.         if Field = 1 then do
  149.             f= f + 1
  150.             if f = 1 then
  151.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  152.             if f = 2 then do
  153.                 GetMain
  154.                 parse var result Name Width Height Blah
  155.                 Scale Width Height/2
  156.                 Swap
  157.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  158.                 Scale Width Height/2
  159.                 Hook Interlace
  160.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  161.                 f = 0
  162.                 end
  163.             end
  164.         else do
  165.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  166.             end    
  167.         end
  168.  
  169. return
  170.  
  171.  
  172. DoIt:
  173.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  174.         Undo On
  175.         exit
  176.         end
  177.     ActiveColor 1
  178.  
  179.     call LoadA()
  180.     GetMain
  181.     parse var result Name Width Height Blah
  182.  
  183.     DrawMode Normal
  184.     if TopType = 0 then do
  185.         if j = 1 then do
  186.             LoadBrush PicAName
  187.             SaveBrushAs ILBM "VFXIFX:TempDrawer/BrushA" 
  188.             end
  189.         if j > 1 then do
  190.             LoadBrush "VFXIFX:TempDrawer/BrushA" 
  191.             Roll XOffA YOffA
  192.             SaveBrushAs ILBM "VFXIFX:TempDrawer/BrushA" 
  193.             end
  194.         FillMode Tile 0 0 0 Smooth
  195.         Num = Height /6
  196.         FilledBox 0 0 Width Num
  197.         DrawMode Normal
  198.         end
  199.     if TopType = 1 then do
  200.         DrawMode Colorize
  201.         ActiveColor TopColor
  202.         Num = Height /6
  203.         FilledBox 0 0 Width Num
  204.         ActiveColor 1
  205.         DrawMode Normal
  206.         end
  207.     if Borders = 1 then do
  208.         ActiveColor ColorA
  209.         FillMode Solid 0 0 0 Smooth
  210.         FilledBox 0 Num-12 Width 12
  211.         DrawMode Darken
  212.         FilledBox 0 Num-3 Width 3
  213.         FilledBox 0 Num-3 Width 3
  214.         DrawMode Lighten
  215.         FilledBox 0 Num-12 Width 3
  216.         FilledBox 0 Num-12 Width 3
  217.         end
  218.     if Shadows = 1 then do
  219.         EdgeMode FeatherOut 3
  220.         DrawMode Darken
  221.         FilledBox 0 Num Width 6
  222.         EdgeMode Normal
  223.         end
  224.     DrawMode Normal
  225.     if BottomType = 0 then do
  226.         if j = 1 then do
  227.             LoadBrush PicBName
  228.             SaveBrushAs ILBM "VFXIFX:TempDrawer/BrushB" 
  229.             end
  230.         if j > 1 then do
  231.             LoadBrush "VFXIFX:TempDrawer/BrushB" 
  232.             Roll XOffB YOffB
  233.             SaveBrushAs ILBM "VFXIFX:TempDrawer/BrushB" 
  234.             end
  235.         FillMode Tile 0 0 0 Smooth
  236.         FilledBox 0 Height-Num Width Height
  237.         DrawMode Normal
  238.         end
  239.     if BottomType = 1 then do
  240.         DrawMode Colorize
  241.         ActiveColor BottomColor
  242.         Num = Height /6
  243.         FilledBox 0 Height-Num Width Height
  244.         ActiveColor 1
  245.         DrawMode Normal
  246.         end
  247.  
  248.  
  249.     if Borders = 1 then do
  250.         ActiveColor ColorB
  251.         FillMode Solid 0 0 0 Smooth
  252.         FilledBox 0 Height-Num Width 12
  253.         DrawMode Darken
  254.         FilledBox 0 (Height-Num)+9 Width 3
  255.         FilledBox 0 (Height-Num)+9 Width 3
  256.         DrawMode Lighten
  257.         FilledBox 0 Height-Num Width 3
  258.         FilledBox 0 Height-Num Width 3
  259.         end
  260.  
  261.     if Shadows = 1 then do
  262.         EdgeMode FeatherOut 3
  263.         DrawMode Darken
  264.         FilledBox 0 (Height-Num)-6 Width 6
  265.         EdgeMode Normal
  266.         end
  267.     DrawMode Normal
  268.     FillMode Solid 0 0 0 Smooth
  269.     KillBrush
  270.     ActiveColor 1
  271. return
  272.  
  273.  
  274.